package com.zjc;

public class LoadJarAtRunTime {

    public static void main(String[] args) throws Exception {

//        String jarPath = "http://localhost/layer4LoadBalancing-1.0-SNAPSHOT.jar";
        String jarPath = "E:\\jar\\layer4LoadBalancing-1.0-SNAPSHOT.jar";
        ClassLoader parent = Thread.currentThread().getContextClassLoader();
        CustomSecureClassLoader classLoader = new CustomSecureClassLoader(parent);
        classLoader.load(jarPath);

        Object rs = ClassForName.execute("com.zjc.Reflex", "java.lang.String,java.lang.String", "s,s1", classLoader);

        if (rs != null) {
            System.out.println(rs);
        }
    }
}


/*
package com.zjc;

public class Reflex {
    public String reflexMethod(String s, String s1) {

        return s + s1;
    }
}
*/





